package com.example.demo;

import com.example.api.JobExecutor;
import com.fasterxml.jackson.databind.json.JsonMapper;
import io.netty.channel.ChannelHandler;

/**
 * @author fanhang
 */
public class NettyServerBoot {

    public static void main(String[] args) throws Exception {
        int port = 9090;
        JsonMapper jsonMapper = JsonMapper.builder().build();
        JobExecutor jobExecutor = new JobExecutor();
        ChannelHandler httpHandler = new NettyHttpHandler(jsonMapper, jobExecutor);

        NettyServer server = new NettyServer(httpHandler, port);
        server.start();
    }

}
